//========================================================================
// *作者：海盗猫  主页：ilplay.com
// *脚本：AssetsHeper
// *描述：
// *?2021 MYJL . All rights reserved.
//* ======================================================================
using System.IO;
using UnityEngine;
using YooAsset;

namespace HDMCode.Hotfix
{
    /// <summary>
    /// 配置热更资源解密方式
    /// </summary>
    public class FileOffsetDecryption : IDecryptionServices
    {
        public AssetBundle LoadAssetBundle(DecryptFileInfo fileInfo, out Stream managedStream)
        {
            throw new System.NotImplementedException();
        }

        public AssetBundleCreateRequest LoadAssetBundleAsync(DecryptFileInfo fileInfo, out Stream managedStream)
        {
            throw new System.NotImplementedException();
        }
    }

    /// <summary>
    /// 配置远端资源服务器地址
    /// </summary>
    public class RemoteServices : IRemoteServices
    {
        private readonly string _defaultHostServer;
        private readonly string _fallbackHostServer;
        public RemoteServices(string defaultHostServer, string fallbackHostServer)
        {
            _defaultHostServer = defaultHostServer;
            _fallbackHostServer = fallbackHostServer;
        }
        public string GetRemoteFallbackURL(string fileName) => $"{_defaultHostServer}/{fileName}";
        public string GetRemoteMainURL(string fileName) => $"{_fallbackHostServer}/{fileName}";
    }
}